<extend name='Public/base'/>

<block name='body'>
    <div class='main-tile'>
        <h2>群猪列表</h2>
    </div>
    <div class='cf'>
        <!-- 按钮工具栏 -->
        <div class='f1'>
            <!--<a class='btn' href="{:U('Lord/user_save')}">添加</a>-->
            <!--<button class="btn ajax-post confirm" url="{:U('user_del')}" target-form="ids">删 除</button>-->
            <button class="btn ajax-post confirm" url="{:U('check')}" target-form="ids">审 核</button>
        </div>
        <!-- 高级搜索栏 -->
        <div class='search-form fr cf'>
            <div class="sleft">
                <div class="drop-down">
                    <span id="sch-sort-txt" class="sort-txt" data="{$check}"><if condition="get_check($check) eq ''">所有<else/>{:get_status_title($status)}</if></span>
                    <i class="arrow arrow-down"></i>
                    <ul id="sub-sch-menu" class="nav-list hidden">
                        <li><a href="javascript:;" value="">所有</a></li>
                        <li><a href="javascript:;" value="0">待审核</a></li>
                        <li><a href="javascript:;" value="1">已审核</a></li>
                    </ul>
                </div>
                <input type="text" name="charge" class="search-input" value="{:I('title')}" placeholder="请输入群主姓名或群名称">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('Lord/index')}"><i class="btn-search"></i></a>
            </div>
        </div>
        <div class='data-table'>
            <table class="">
                <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th>排名</th>
                    <th>群名称</th>
                    <th>群主姓名</th>
                    <th>联系方式</th>
                    <th>浏览量</th>
                    <th>粉丝数量</th>
                    <th>投票数量</th>
                    <th>创建时间</th>
                    <th>是否审核</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name='list' id='vo'>
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.lord_id}" /></td>
                        <td>{$vo.num}</td>
                        <td>{$vo.lord_name}</td>
                        <td>{$vo.user_name}</td>
                        <td>{$vo.user_phone}</td>
                        <td>{$vo.scan_num}</td>
                        <td>{$vo.fans_num}</td>
                        <td>{$vo.voet_num}</td>
                        <td>{$vo.create_time|time_format='Y-m-d'}</td>
                        <eq name="vo['check']" value="1">
                            <td style="color: #008200">已审核</td>
                        <else/>
                            <td><a style="color: red" href="{:U('Lord/check?ids='.$vo['lord_id'])}">审 核</a> </td>
                        </eq>
                        <td>
                            <a href="{:U('Lord/voet?lord_id='.$vo['lord_id'])}">查看投票列表</a>
                            <!--<a href="{:U('Lord/user_save?id='.$vo['lord_id'])}">编辑</a>-->
                            <a class="confirm ajax-get" href="{:U('Lord/user_del?ids='.$vo['lord_id'])}">删除</a>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
        </div>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        /* 状态搜索子菜单 */
        $(".search-form").find(".drop-down").hover(function(){
            $("#sub-sch-menu").removeClass("hidden");
        },function(){
            $("#sub-sch-menu").addClass("hidden");
        });
        $("#sub-sch-menu li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                $("#sub-sch-menu").addClass("hidden");
            })
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Lord/index')}');
    </script>
</block>
